package org.wmq.taskschedule.factory;

import org.springframework.beans.BeanUtils;
import org.wmq.taskschedule.algorithm.AlgorithmExecutor;
import org.wmq.taskschedule.algorithm.HistogramEqualizationExecutor;
import org.wmq.taskschedule.biz.model.DO.Param;

/**
 * 直方图均衡化算法执行器工厂类
 * 实现AlgorithmExecutorFactory接口，用于创建HistogramEqualizationExecutor实例
 */
public class HistogramEqualizationExecutorFactory implements AlgorithmExecutorFactory {
    private static final HistogramEqualizationExecutorFactory instance = new HistogramEqualizationExecutorFactory();

    private HistogramEqualizationExecutorFactory() {}
    
    /**
     * 获取工厂实例
     * @return HistogramEqualizationExecutorFactory实例
     */
    public static HistogramEqualizationExecutorFactory getInstance() {
        return instance;
    }
    
    @Override
    public AlgorithmExecutor getAlgorithmExecutor(Param param) {
        HistogramEqualizationExecutor histogramEqualizationExecutor = new HistogramEqualizationExecutor();
        BeanUtils.copyProperties(param, histogramEqualizationExecutor);
        return histogramEqualizationExecutor;
    }
}